//
// Created by ms on 2025/10/21.
//

#ifndef _SLIDEFILTER_H
#define _SLIDEFILTER_H

#include <stddef.h>
#include <stdint.h>

class SlideFilter {
public:
	SlideFilter(size_t size);
	SlideFilter(float* buf, size_t size);
	~SlideFilter();

	void  clear();
	float operator()(float input);

private:
	float* buffer;
	size_t _size;

	bool is_static_buffer;

	struct {
		float  last_del;
		size_t index;
		size_t count;
		double sum;
	} priv;
};


#endif //_SLIDEFILTER_H
